<!DOCTYPE html>
<html>

	<head>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<title><?php echo $title; ?></title>

		<!-- Core CSS - Include with every page -->
		<link href="<?php echo base_url() . B_CSS; ?>bootstrap.min.css" rel="stylesheet">
		<link href="<?php echo base_url() . B_FONT_AWESOME; ?>css/font-awesome.css" rel="stylesheet">

		<!-- Page-Level Plugin CSS - Dashboard -->
		<!--<link href="<?php echo base_url() . B_CSS; ?>plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
		<link href="<?php echo base_url() . B_CSS; ?>plugins/timeline/timeline.css" rel="stylesheet">-->

		<!-- Page-Level Plugin CSS - Tables -->
		<link href="<?php echo base_url() . B_CSS; ?>plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

		<!-- SB Admin CSS - Include with every page -->
		<link href="<?php echo base_url() . B_CSS; ?>sb-admin.css" rel="stylesheet">
		<style>
			.error {
				color: red !important;
			}
			.star_require {
				color: red !important;
			}
		</style>

	</head>

	<body>

		<div id="wrapper">
			
			
			<?php $this -> load -> view(B_MASTER . "topbar"); ?>
			<!-- /.navbar-static-top -->

			<?php $this -> load -> view(B_MASTER . "sidebar"); ?>
			<!-- /.navbar-static-side -->

			<div id="page-wrapper">
				<!--Notification message system-->
				
			<?php $this -> load -> view(B_MASTER . "notification"); ?>
			
				<?php
				if ($this -> uri -> segment(1) == "") {
					$this -> load -> view(B_MASTER . "main");
				} else {
					$this -> load -> view(B_TEMPLATE . str_replace('-', '_', $this -> uri -> segment(1)) . '/' . (($this -> uri -> segment(2) == '') ? 'index' : str_replace('-', '_', $this -> uri -> segment(2))));
				}
				?>
			</div>
			<!-- /#page-wrapper -->

		</div>
		<!-- /#wrapper -->

		<!-- Core Scripts - Include with every page -->
		<script src="<?php echo base_url() . B_JS; ?>jquery-1.10.2.js"></script>
		<script src="<?php echo base_url() . B_JS; ?>bootstrap.min.js"></script>
		<script src="<?php echo base_url() . B_JS_PLUGIN; ?>metisMenu/jquery.metisMenu.js"></script>

		<!-- Page-Level Plugin Scripts - Dashboard -->
		<!--<script src="<?php echo base_url() . B_JS_PLUGIN; ?>morris/raphael-2.1.0.min.js"></script>
		<script src="<?php echo base_url() . B_JS_PLUGIN; ?>morris/morris.js"></script>-->

		<!-- Page-Level Plugin Scripts - Tables -->
		<script src="<?php echo base_url().B_JS_PLUGINS_DATATABLE;?><?php echo $this->config->item('language');?>/jquery.dataTables.js"></script>
    	<script src="<?php echo base_url().B_JS_PLUGINS_DATATABLE;?><?php echo $this->config->item('language');?>/dataTables.bootstrap.js"></script>
		<!--<script src="<?php echo base_url() . B_JS_PLUGIN; ?>dataTables/jquery.dataTables.js"></script>
		<script src="<?php echo base_url() . B_JS_PLUGIN; ?>dataTables/dataTables.bootstrap.js"></script>-->

		<!-- SB Admin Scripts - Include with every page -->
		<script src="<?php echo base_url() . B_JS; ?>sb-admin.js"></script>

		<!-- Page-Level Demo Scripts - Dashboard - Use for reference -->
		<!--<script src="<?php echo base_url() . B_JS; ?>demo/dashboard-demo.js"></script>-->

		<script>
			$(document).ready(function() {
				$('#dataTables-example').dataTable();
					
			});
			
		</script>

		<script type="text/javascript">
			var checkflag = "false";
			function check(field) {

				if (checkflag == "false") {
					for ( i = 0; i < field.length; i++) {
						field[i].checked = true;
					}
					checkflag = "true";
					return "Uncheck All";
				} else {
					for ( i = 0; i < field.length; i++) {
						field[i].checked = false;
					}
					checkflag = "false";
					return "Check All";
				}
			}

		</script>
		
<script>
	function checkAll(checkEm) {
		var cbs = document.getElementsByTagName('input');
		for (var i = 0; i < cbs.length; i++) {
			if (cbs[i].type == 'checkbox') {
				if (cbs[i].name == 'module_modify[]') {
					cbs[i].checked = checkEm;
				}
			}
		}
	}

	function checkAllAccess(checkEm) {
		var cbs = document.getElementsByTagName('input');
		for (var i = 0; i < cbs.length; i++) {
			if (cbs[i].type == 'checkbox') {
				if (cbs[i].name == 'module_access[]') {
					cbs[i].checked = checkEm;
				}
			}
		}
	}
</script>

<script>
	function goBack() {
		window.history.back()
	}
</script>
	</body>

</html>
